From: Sebastian Keller Date: Sun, 12 Feb 2023 17:13:59 +0000 (+0100) Subject: authPrompt: Manually destroy inactive/unused entry X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~20 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=572d011894c9b490b8a17ad7db6adec335fbb017;p=gnome-shell.git authPrompt: Manually destroy inactive/unused entry AuthPrompt creates two entries, one for text and one for passwords, but only ever one is used as child widget. This would lead to the other one not getting destroyed when the the AuthPrompt is destroyed. This now manually destroys the inactive one when the AuthPrompt is destroyed to avoid that leak. Related: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6395 Part-of: --- diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index 97b12ef54..e48e422fa 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -120,6 +120,8 @@ var AuthPrompt = GObject.registerClass({ } _onDestroy() { + this._inactiveEntry.destroy(); + this._inactiveEntry = null; this._userVerifier.destroy(); this._userVerifier = null; } @@ -189,6 +191,7 @@ var AuthPrompt = GObject.registerClass({ this._entry = this._passwordEntry; this._mainBox.add_child(this._entry); this._entry.grab_key_focus(); + this._inactiveEntry = this._textEntry; this._timedLoginIndicator = new St.Bin({ style_class: 'login-dialog-timed-login-indicator', @@ -278,9 +281,11 @@ var AuthPrompt = GObject.registerClass({ if (secret && this._entry !== this._passwordEntry) { this._mainBox.replace_child(this._entry, this._passwordEntry); this._entry = this._passwordEntry; + this._inactiveEntry = this._textEntry; } else if (!secret && this._entry !== this._textEntry) { this._mainBox.replace_child(this._entry, this._textEntry); this._entry = this._textEntry; + this._inactiveEntry = this._passwordEntry; } this._capsLockWarningLabel.visible = secret; }